<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
 */

//安装引导界面
Route::group(
    [
        'prefix'    => 'install',
        'namespace' => 'Install',
    ],
    function () {
        Route::get('/step1', 'Index@step1');
        Route::get('/step2', 'Index@step2');
        Route::post('/step3', 'Index@step3');
        Route::get('/step4', 'Index@step4');
        Route::get('/step5', 'Index@step5');
    }
);

//前台
Route::get('/', 'Home\Article@index');
Route::group(
    [
        'prefix'    => 'home',
        'namespace' => 'Home',
    ],
    function () {
        Route::get('/article/index', 'Article@index')->name('home/article/index');
        Route::get('/article/detail/{article_id?}', 'Article@detail');
        Route::post('/replies/add', 'Replies@add');
    }
);

//后台
Route::get('/admin/login', 'Admin\Login@index'); //登录页面
Route::post('/admin/login/verify', 'Admin\Login@verify'); //登录认证页面
Route::get('/admin/signOut', 'Admin\Login@signOut'); //退出
Route::group(
    [
        'prefix'     => 'admin',
        'namespace'  => 'Admin',
        'middleware' => ['admin'],
    ],
    function () {
        Route::get('/', 'Index@main');
        Route::get('/index/main', 'Index@main');
        Route::get('/login_log/index', 'LoginLog@index');
        Route::resource('/article', 'Article');
        Route::resource('/category', 'Category');
        Route::resource('/admin', 'Admin');
        Route::resource('/replies', 'Replies');
        Route::resource('/friendly_link', 'FriendlyLink');
    }
);
